package com.burstly.lib.util;

import com.burstly.lib.component.networkcomponent.burstly.html.IDestroyableActivityLifecycleAware;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

public abstract class SafeRunnable
  implements Runnable
{
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = SafeRunnable.class.getSimpleName();
  private final Reference<IDestroyableActivityLifecycleAware> mLifecycleAware;

  public SafeRunnable(IDestroyableActivityLifecycleAware paramIDestroyableActivityLifecycleAware)
  {
    this.mLifecycleAware = new WeakReference(paramIDestroyableActivityLifecycleAware);
  }

  public abstract void doRun();

  public final void run()
  {
    try
    {
      IDestroyableActivityLifecycleAware localIDestroyableActivityLifecycleAware = (IDestroyableActivityLifecycleAware)this.mLifecycleAware.get();
      if ((localIDestroyableActivityLifecycleAware != null) && (!localIDestroyableActivityLifecycleAware.wasDestroyed()))
        doRun();
      return;
    }
    catch (Exception localException)
    {
      LOG.logThrowable(TAG, localException);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.util.SafeRunnable
 * JD-Core Version:    0.6.2
 */